<template>
  <view class="article-card" @click="$toPage(`/pages/fzbz/disputeDetail?indexCode=${row.indexCode}&disputeName=${disputeName}`)">
    <!-- 标题部分 -->
    <h2 class="title">{{ row.disputeTitle }}</h2>
    <!-- 标签部分 -->
    <view class="tags">
      <article-tag :text="disputeName"/>
    </view>
    <!-- 内容部分 -->
    <view class="content">
      <p>{{ row.disputeContent }}</p>
    </view>
    <!-- 日期部分 -->
    <view class="date">{{ row.createTime }}</view>
  </view>
</template>

<script>
import ArticleTag from "../../../components/ArticleTag.vue";
export default {
  name: 'DisputeCard',
  components:{ArticleTag},
  props: {
    row: {
      type: Object,
      required: true,
      default: () => ({})
    },
    typeList: {
      type: Array,
      default: () => ([])
    }
  },
  computed:{
    disputeName(){
      let map = this.typeList.find(item=>item.value === this.row.disputeType)
      return map && map.text
    }
  }
}
</script>

<style scoped lang="scss">
.article-card {
  background-color:$uni-color-success;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.title {
  color:$uni-color-primary;
  font-size: 17px;
  font-weight: bold;
  margin-bottom: 10px;
}

.tags {
  margin-bottom: 10px;
}

.content {
  color: #333;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.date {
  color: #999;
  font-size: 13px;
}
</style>
